xend: pass-through: Implement least-mapping of virtual functions
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 27 Jun 2009 09:01:20 +0000 (10:01 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 27 Jun 2009 09:01:20 +0000 (10:01 +0100)
commit4cc88b66d746ed98357ee3b01814725d463cf7a2
treee1b484c03de566cc34517dcb1a65c40f426ddc48
parente22b1a81b3b9de818a2f070f37f1630bdc596d82
xend: pass-through: Implement least-mapping of virtual functions

This is an alternative to identity mapping virtual functions.

It works by assigning the numerically lowest virtual function that is
available.

* The order of assignment is thus dependent on the order that physical
  functions are specified.

  e.g.
  config         physical     virtual
  01.00.0,2  ->  01:00.0  ->  00:07.0
             ->  01:00.2  ->  00:07.1

  is different to

  config         physical     virtual
  01.00.2,0  ->  01:00.2  ->  00:07.0
             ->  01:00.0  ->  00:07.1

* Physical function 0 need not be present

  e.g.
  config         physical     virtual
  01.00.1,2  ->  01:00.1  ->  00:07.0
             ->  01:00.2  ->  00:07.1

* Functions from the same physical multi-function device
  may be exported as multiple multi-function and single-function
  devices

  e.g.
  01.00.0,2  ->  01:00.0  ->  00:07.0
             ->  01:00.2  ->  00:07.1
  and
  01.00.1,3  ->  01:00.1  ->  00:08.1
             ->  01:00.3  ->  00:08.1
  and
  01.00.5    ->  01:00.5  ->  00:09.0

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/util/pci.py
tools/python/xen/xm/main.py